package com.zhixing.common;

/**
 * swagger 相关常量信息
 * <p> 例如：json 字段名等 </p>
 * @author zhixing
 */
public interface ISwaggerConstants {

    /*{
        "swagger":"2.0",
            "info":{
        "version":"1.0",
                "title":"ship管理",
                "license":{

        }
    },
        "host":"api.xn.net",
            "basePath":"/",
            "tags":Array[16],
            "paths":Object{...},
        "definitions":Object{...}
    }*/

    String SWAGGER      = "swagger";

    String INFO         = "info";

    String VERSION      = "version";

    String TITLE        = "title";

    String TAG          = "tag";

    // paths 结构下的相关字段名称定义
    String PATHS        = "paths";
    public interface IPATHS{
        /** tags 名称 **/
        String TAGS          = "tags";

        /** 接口描述 **/
        String SUMMARY       = "summary";

        /** 方放名 **/
        String OPERATION_ID  = "operationId";

        /** 入参格式 **/
        String CONSUMER      = "consumes";

        /** 返回结果格式 **/
        String PRODUCES      = "produces";

        /** 请求入参 **/
        String PARAMETERS    = "parameters";

        /** 请求入参相关 **/
        interface IPARAMETERS{
            /** 入参类型，如：body、query {@linkParametersInTypeEnums } **/
            String IN = "in";

            interface IIN{
                String HEADER   = "header";
                String QUERY    = "query";
                String BODY     = "body";
            }
        }

        /** 结果集 **/
        String RESPONSES     = "responses";

        interface IRESPONSE{
            String DESC             = "description";
            String ORIGINAL_REF     = "originalRef";
        }

        /** 请求入参返回结果结果集对象 **/
        String SCHEMA        = "schema";

        /** 字段类型 {@link IDATA_TYPE } **/
        String FILED_TYPE    = "type";
    }


    // definitions 结构下的相关字段名称定义
    String DEFINITIONS  = "definitions";

    public interface IDEFINITIONS{
        /** 字段类型 **/
        String TYPE             = "type";

        /** 关联对象名对象引用集合对象 **/
        String ITEMS            = "items";

        /** 关联对象引用 **/
        String ITEMS_REF        = "$ref";

        /** 关联对象引用前缀字符串 **/
        String ITEMS_REF_PREFIX = "#/definitions/";

        /** 字段描述 **/
        String DESC             = "description";

        /** 所有字段属性 **/
        String PROPERTIES       = "properties";

        String TITLE            = "title";

        String ALL_OF            = "allof";
    }

    /** 数据类型 **/
    interface IDATA_TYPE {
        String ARRAY                    = "array";
        String STRING                   = "string";
        String STRING_DATE              = "string(date-time)";
        String INTEGER                  = "integer";
        String INTEGER_64               = "integer(int64)";
        String INTEGER_32               = "integer(int32)";
        String NUMBER                   = "number";
        String BOOLEAN                  = "boolean";
        String FILE                     = "file";
        String OBJECT                   = "object";
        String LOCALDATETIME            = "LocalDateTime";
        String LOCALDATE                = "LocalDate";
    }
}
